#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
#include "register.h"

int section_count = 0;

void register_section(const char* name, void* data, SectionHandlerTwo handler2, SectionHandlerThree handler3) 
{
    if (section_count < MAX_SECTIONS) {
        sections[section_count].name = name;
        sections[section_count].data = data;
        if (handler2 != NULL) {
            sections[section_count].handler2 = handler2;
        } else if (handler3 != NULL) {
            sections[section_count].handler3 = handler3;
        }
        section_count++;
    } else {
        printf("Error: Too many sections!\n");
    }
}
